package com.czd.support.service;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import com.czd.base.model.Paginate;
import com.czd.base.service.BaseService;
import com.czd.support.model.Order;

@Service
public class OrderService   extends   BaseService<Order>{
        
	public     List<Order>  findAll  (){
	   return   this.selectList("findAll")  ;
	}
	
	
	 public Paginate queryForPage(Order order , String kw) {
		 order.setWhere(" 1=1");
	        if(StringUtils.isNotBlank(kw)){
	        	order.setWhere(order.getWhere() + " and (cf_consignee.consigneeMobile like '"+kw+"%' or cf_order.id like '"+kw+"%'   )");
	        }
			return this.queryForPaginate(sqlId("queryForPage"), order);
		}
	 
	 
	 
	 public   Order   findDetail(int  id){
		return      this.selectOne("findDetail", id);
	 }
	 
	 
	 public  void  updateDeliver(Order  order ){
		 this.update("updateDeliver", order);
	 }
	 
	 
	 public Paginate queryForPageDeliver(Order order ) {
			return this.queryForPaginate(sqlId("queryForPageDeliver"), order);
		} 
}
